//
//  YGJHomeVC.m
//  ygj-customer-iOS
//
//  Created by apple on 16/11/10.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "YGJHomeVC.h"

#import "YGJNavigationController.h"

@interface YGJHomeVC ()



@end

@implementation YGJHomeVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.view.backgroundColor = [UIColor redColor];
    [self initScroller];

    [self setNavgationBarButton];
    
    
}

#pragma mark 设置导航栏左右按钮
-(void) setNavgationBarButton {
    UIBarButtonItem * leftItem = [[UIBarButtonItem alloc] initWithTitle:@"上海市" style:UIBarButtonItemStylePlain target:self action:@selector(leftAction)];
    self.navigationItem.leftBarButtonItem = leftItem;
    
    UIBarButtonItem * rightItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"phone1"] style:UIBarButtonItemStylePlain target:self action:@selector(rightAction)];
    self.navigationItem.rightBarButtonItem = rightItem;
    
}

#pragma mark 导航栏按钮事件
-(void) leftAction {
    NSLog(@"点击---->首页左侧导航按钮");
}

-(void) rightAction {
    NSLog(@"点击---->首页右侧导航按钮");

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"4000022699"]] options:@{} completionHandler:nil];
    
}

-(void) initScroller {

    self.pwscrollView = [[PWScrollView alloc]initWithFrame:CGRectMake(0, 60, [UIScreen  mainScreen].bounds.size.width, 200) ImagesArray:@[@"banner1",@"banner2",@"banner4",@"banner5"]];
    [self.pwscrollView tapImageViewBlock:^(NSInteger tag) {
        
        NSLog(@"点击图片Block回调  %zd",tag);
        
        
    }];
    
    [self.view addSubview:self.pwscrollView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
